﻿<MudTable Items="_items" CanCancelEdit="true">
    <HeaderContent>
        <MudTh>Id</MudTh>
        <MudTh>Value</MudTh>
    </HeaderContent>
    <RowTemplate>
        <MudTd>@context.Id</MudTd>
        <MudTd>@context.Value</MudTd>
    </RowTemplate>
    <RowEditingTemplate>
        <MudTd>
            <MudTextField @bind-Value="@context.Id"></MudTextField>
        </MudTd>
        <MudTd>
            <MudTextField @bind-Value="@context.Value"></MudTextField>
        </MudTd>
    </RowEditingTemplate>
</MudTable>

@code {
    private readonly List<Element> _items =
    [
        new() { Value = "A", Id = "Id1" },
        new() { Value = "B", Id = "Id2" },
        new() { Value = "C", Id = "Id3" }
    ];

    public class Element
    {
        public required string Id { get; set; }

        public required string Value { get; set; }
    }
}